<?php
/**
 * @file
 * @package mileage
 * @version $Id$
**/

if (!defined('XOOPS_ROOT_PATH')) {
    exit;
}

/**
 * Mileage_ImageObject
**/
class Mileage_MileObject extends XoopsSimpleObject
{
	public $mile_number  = NULL;
	public $total_points = NULL;
	public $canGetPoint  = FALSE;

	/**
	 * __construct
	 * 
	 * @param   void
	 * 
	 * @return  void
	**/
	public function __construct()
	{
		$this->initVar('mile_id',      XOBJ_DTYPE_INT,    '', FALSE);
		$this->initVar('name',         XOBJ_DTYPE_STRING, '', FALSE, 255);
		$this->initVar('point',        XOBJ_DTYPE_INT,    '', FALSE);
		$this->initVar('uid',          XOBJ_DTYPE_INT,    '', FALSE);
		$this->initVar('reg_unixtime', XOBJ_DTYPE_INT,    '', FALSE);
		$this->initVar('url',          XOBJ_DTYPE_STRING, '', FALSE, 255);
		$this->initVar('suburl',       XOBJ_DTYPE_INT,    '', FALSE);
		$this->initVar('interval',     XOBJ_DTYPE_INT,    '', FALSE);
		$this->initVar('group',        XOBJ_DTYPE_STRING, '', FALSE, 255);
	}
}

/**
 * Mileage_MileHandler
**/
class Mileage_MileHandler extends XoopsObjectGenericHandler
{
	/**
	 * @brief   string
	**/
	public $mTable = NULL;

	/**
	 * @brief   string
	**/
	public $mPrimary = 'mile_id';

	/**
	 * @brief   string
	**/
	public $mClass = 'Mileage_MileObject';

	/**
	 * __construct
	 * 
	 * @param   XoopsDatabase  &$db
	 * @param   string  $dirname
	 * 
	 * @return  void
	**/
	public function __construct(&$db, $dirname)
	{
		$this->mTable = $dirname . '_mile';//str_replace('{dirname}',$dirname,$this->mTable);
		parent::XoopsObjectGenericHandler($db);
	}
}

